package com.chen.manager.controller;

import com.chen.manager.service.OrderInfoService;
import com.chen.model.dto.order.OrderStatisticsDto;
import com.chen.model.entity.order.OrderInfo;
import com.chen.model.vo.common.Result;
import com.chen.model.vo.common.ResultCodeEnum;
import com.chen.model.vo.order.OrderStatisticsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cgj
 * @date 3/23/25 9:02 AM
 */
@RestController
@RequestMapping("/admin/order/orderInfo")
public class OrderInfoController {
     @Autowired
    private OrderInfoService orderInfoService;

    /**
     * 查询指定时间的订单数据
     * @param orderStatisticsDto
     * @return
     */
     @GetMapping("/getOrderStatisticsData")
    public Result<OrderStatisticsVo> getOrderStatisticsData(OrderStatisticsDto orderStatisticsDto){
         OrderStatisticsVo orderStatisticsVo=orderInfoService.getOrderStatisticsData(orderStatisticsDto);
         return Result.build(orderStatisticsVo, ResultCodeEnum.SUCCESS);
     }

}
